package com.whj.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whj.entity.Goods;
import com.whj.mapper.GoodsDao;
import com.whj.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl implements GoodService {
    @Autowired
    private GoodsDao goodsdao;
    @Override
    public IPage<Goods> showGoodsPage(Integer pageNum) {
        IPage<Goods> page = new Page<>(pageNum,8);
        return goodsdao.selectPage(page, null);
    }

    @Override
    public Goods showGoodsDetail(Integer id) {
        return goodsdao.selectById(id);
    }
}
